//
//  WZLCoreDataToChatManager.h
//  coreDataToChat
//
//  Created by WangZe on 15/11/24.
//  Copyright © 2015年 王泽龙. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>
@interface WZLCoreDataToChatManager : NSObject
@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator;
+ (instancetype)shareWZLCoreDataToChatManager;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;

// 添加消息 : 参数1 : 消息内容 参数2: 消息来源 参数3 : 消息去向
- (void)addMessage:(NSString *)mes fromName:(NSString *)from toName:(NSString *)to;

// 检索本地消息 参数formatString:检索条件
- (NSArray *)selectMessageWithFormat:(NSString *)formatString;


@end
